package ExerciseOne;

public class HourlyEmployee extends Employee{
	
	private int wage;//每小时的工资
	private int hour;//小时数
	
	public HourlyEmployee()
	{
		
	}

	public HourlyEmployee(String name,int number,Mydate birthday,int wage, int hour) {
		super(name, number, birthday);
		this.wage = wage;
		this.hour = hour;
	}
	
	public int getWage() {
		return wage;
	}

	public void setWage(int wage) {
		this.wage = wage;
	}

	public int getHour() {
		return hour;
	}

	public void setHour(int hour) {
		this.hour = hour;
	}

	@Override//重写父类方法
	public double earnings() {
		return wage*hour;
	}

	@Override
	public String toString() {
		return "HourlyEmployee "+super.toString();
	}
}
